package com.agu.mgt.sys.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agu.utils.Query;

import java.util.List;
import java.util.Map;

import com.agu.mgt.sys.dao.SysLogDao;
import com.agu.entity.sys.SysLogEntity;
import com.agu.mgt.sys.service.SysLogService;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;


@Service("sysLogService")
@Transactional(readOnly = true)
public class SysLogService{
	@Autowired
	private SysLogDao sysLogDao;
	
	
	public SysLogEntity queryObject(Long id){
		return sysLogDao.queryObject(id);
	}
	
	
	public List<SysLogEntity> queryList(Map<String, Object> map){
		return sysLogDao.queryList(map);
	}

    
	public Page<SysLogEntity> queryPageList(Query query){
	    PageHelper.startPage(query.getPage(), query.getLimit());
	    return sysLogDao.queryPageList(query);
	}
	
	
	public int queryTotal(Map<String, Object> map){
		return sysLogDao.queryTotal(map);
	}
	
	
	@Transactional
	public void save(SysLogEntity sysLog){
		sysLogDao.save(sysLog);
	}
	
	
	@Transactional
	public void update(SysLogEntity sysLog){
		sysLogDao.update(sysLog);
	}
	
	
	@Transactional
	public void delete(Long id){
		sysLogDao.delete(id);
	}
	
	
	@Transactional
	public void deleteBatch(Long[] ids){
		sysLogDao.deleteBatch(ids);
	}
}
